// +----------------------------------------------------------------------
// | 全局设置
// | 本页面守则
// | 1. 所有设置项只能写在config类中
// | 2. 所有设置项尽量做到不可修改，只由人手修改相应值
// | 3. 全局性不可更改的设置都在本页面设置，如接口公共域名等，可更改或需要获取的，在状态管理中保存
// +----------------------------------------------------------------------

part of 'global.dart';

/// 安装渠道
enum ApkChannel { normal, douyin, baidu }

class Config {
  // --------- 系统环境设置 ---------

  /// 当前渠道
  static const ApkChannel apkChannel = ApkChannel.normal;

  // ---------------------------

  // --------- 系统环境设置 ---------

  /// 设置调试开关
  static const bool debugEnv = true;

  /// 接口环境环境
  static const String httpEnv = "production";

  // ---------------------------

  // --------- 接口设置 ---------

  /// 接口地址前缀
  static const Map httpUrls = {
    "production": "http://api.tangzhijiaowh.cn/api/",
    "development": "http://api.tangzhijiaowh.cn/api/",
  };

  /// 连接服务器超时时间，单位是毫秒.
  static const int connectTimeout = 500000;

  /// 接收数据的最长时限，单位是毫秒.
  static const int receiveTimeout = 200000;

  // ---------------------------

  // --------- websocket设置 ---------

  /// 客服人员token
  static const String CUSTOMERSERVICESTAFF = '338d2551733cfac58bb242f71e47857d';

  /// websocket普通地址
  static const Map wsUrls = {
    // "production": "ws://47.115.29.90:7777",
    "production": "ws://47.115.29.90:8888",
    "development": "ws://47.115.29.90:8888",
  };

  /// websocket计费地址
  static const Map wsUrls2 = {
    "production": "ws://47.115.29.90:8889",
    "development": "ws://47.115.29.90:8889",
  };

  /// 普通ws心跳时间间隔
  static const Duration WS_HEARTBEAT_TIME = Duration(seconds: 20);

  /// 计费ws心跳时间间隔
  static const Duration VIDEO_HEARTBEAT_TIME = Duration(seconds: 5);

  // ---------------------------

  // --------- 微信设置 ---------

  /// 微信appid
  static const String WECHAT_APPID = "wx9bddb4a67d6a163f";

  /// 微信appsecret
  static const String WECHAT_APPSECRET = "21ee63cd2d2fae6261e427f9e8d7db38";

  /// 微信通用连接
  static const String WECHAT_UNIVERSAL_LINK = "https://x86utq.openinstall.io/";

  /// 微信分享标题
  static const String WECHAT_SHARE_TITLE = "探果直播";

  /// 微信分享内容
  static const String WECHAT_SHARE_DESCRIPTION = "独绽！为您独自绽放，单身男女都在嗨！";

  /// 微信分享logo
  static const String WECHAT_SHARE_LOGO = "assets/images/icon/logo.jpg";

  /// 微信分享地址
  static const String WECHAT_SHARE_URL = 'http://phone.tangzhijiaowh.cn/';

  // ---------------------------

  // --------- QQ设置 ---------

  /// QQ appid
  static const String QQ_APPID = "1110639193";

  /// QQ appkey
  static const String QQ_APPKEY = "cGdMgCE7cehFcxio";

  /// 微信通用连接
  static const String TENCENT_UNIVERSAL_LINK = "https://x86utq.openinstall.io/";

  /// QQ 分享标题
  static const String QQ_SHARE_TITLE = "探果直播";

  /// QQ 分享内容
  static const String QQ_SHARE_DESCRIPTION = "独绽！为您独自绽放，单身男女都在嗨！";

  /// QQ 分享logo
  static const String QQ_SHARE_LOGO = "assets/images/icon/logo.jpg";

  /// QQ 分享地址
  static const String QQ_SHARE_URL = 'http://api.duzhanjiaoyou.com/dist/';

  // ---------------------------

  // --------- 声网设置 --------- ok

  /// Agora AppId
  static const String AGORA_APP_ID = "2cae65e4d28c4546813c2a142217d1ca";

  /// 开关本地视频
  static const bool AGORA_VIDEO_ENABLED = true;

  // ---------------------------

  // --------- DB设置 ---------

  /// 数据库名
  static const String DATABASES_NAME = "chat.db";

  /// 私聊列表 表名
  static const String MESSAGE_TABLE_NAME = "message";

  // ---------------------------

  // --------- 高德地图设置 --------- ok

  /// 高德地图ios key | 安卓key要去 app/src/main/AndroidManifest.xml 中替换
  static const String AMAP_KEY = "31d614953b80f1457ac6248db9d87ae3";

  // ---------------------------

  // --------- 腾讯信鸽设置 ---------

  /// 信鸽appid
  static const XG_APPID = "4386d624fa054";

  /// 信鸽secret_key
  static const XG_SECRET_KEY = "b6455cba044661c2fd753e2c85083f05";

  /// 信鸽access id
  static const XG_ACCESS_ID = "2100351566";

  /// 信鸽access key
  static const XG_ACCESS_KEY = "AYC6H4W5N61Z";

  // ---------------------------

  // --------- 极光推送设置 ---------

  /// 信鸽appid
  static const JPUSH_APPKEY = "62c7b70e9f86ac8cbece6e93";

  // ---------------------------

  // --------- 系统设置 ---------

  /// 是否开启沉浸式状态栏
  static const bool immersive = true;

  /// 状态栏的样式
  static const SystemUiOverlayStyle statusBarStyle = SystemUiOverlayStyle(
    statusBarColor: Colors.transparent,
    statusBarIconBrightness: Brightness.dark,
    statusBarBrightness: Brightness.light,
  );

  /// 屏幕方向 none不设置 column强制竖屏 row强制横屏
  static const String screenDirection = "column";

  /// 状态栏 和 底部虚拟键 的开关控制 none两者都开启 top隐藏底部 bottom隐藏状态栏
  static const String systemUiOverlay = "none";

  /// 图片404时的替代图片地址
  static final Image errorNetImage = Image.asset(
    "assets/images/icon/logo.jpg",
    fit: BoxFit.cover,
  );

  // ---------------------------

  // --------- 读取项 ---------

  /// 调试状态(生产模式强制关闭debug)
  static bool get debug =>
      !bool.fromEnvironment("dart.vm.product") ? debugEnv : false;

  /// 当前接口前缀(生产模式强制production)
  static String get baseUrl => !bool.fromEnvironment("dart.vm.product")
      ? httpUrls[httpEnv]
      : httpUrls['production'];

  /// websocket普通地址
  static String get wsConnectAddress => !bool.fromEnvironment("dart.vm.product")
      ? wsUrls[httpEnv]
      : wsUrls['production'];

  /// websocket计费地址
  static String get wsChargingAddress =>
      !bool.fromEnvironment("dart.vm.product")
          ? wsUrls2[httpEnv]
          : wsUrls2['production'];

  // ---------------------------

}
